using System;
using System.Collections.Generic;
using System.Text;

namespace WCSFContrib.ECommerceCatalog.BusinessEntities
{
    public class CartItem
    {
        private int cartId;

        public int CartId
        {
            get { return cartId; }
            set { cartId = value; }
        }

        private Item item;

        public Item Item
        {
            get { return item; }
            set { item = value; }
        }

        private int quantity;

        public int Quantity
        {
            get { return quantity; }
            set { quantity = value; }
        }

        public CartItem()
        {
        }

        public CartItem(int cartId, Item item, int quantity)
        {
            if (item == null)
                return;
            
            this.cartId = cartId;
            this.item = new Item(item.ItemId, item.Name, item.Description, item.Image, item.Stock, item.Price, item.Category);
            this.quantity = quantity;
        }
    }
}
